Fedora 26
Sponsored Link

Chroot Environment
2017/07/17
  Configute chroot environment.
Simply install "bind-chroot" package to do so. If you edit named.conf or other zone files on chroot environment, edit configuration files under /var/named/chroot/.
[root@dlp ~]#
dnf -y install bind-chroot
[root@dlp ~]#
/usr/libexec/setup-named-chroot.sh /var/named/chroot on

[root@dlp ~]#
systemctl stop named

[root@dlp ~]#
systemctl disable named

[root@dlp ~]#
systemctl start named-chroot

[root@dlp ~]#
systemctl enable named-chroot

Created symlink from /etc/systemd/system/multi-user.target.wants/named-chroot.service to /usr/lib/systemd/system/named-chroot.service.
[root@dlp ~]#
ll /var/named/chroot/etc

total 24
drwxr-x---. 3 root named   23 Jul 18 10:42 crypto-policies
-rw-r--r--. 2 root root   318 Mar 28 11:15 localtime
drwxr-x---. 2 root named    6 Jul  1 01:45 named
-rw-r-----. 1 root named 2223 Jul 18 10:30 named.conf
-rw-r--r--. 1 root named 3923 Jul  1 01:45 named.iscdlv.key
-rw-r-----. 1 root named  931 Jun 21  2007 named.rfc1912.zones
-rw-r--r--. 1 root named 1886 Apr 13 23:17 named.root.key
drwxr-x---. 3 root named   25 Jul 18 10:42 pki
-rw-r-----. 1 root named   77 Jul 18 10:33 rndc.key

[root@dlp ~]#
ll /var/named/chroot/var/named

total 24
-rw-r--r--. 1 root  root   344 Jul 18 10:32 0.0.10.db
drwxr-x---. 7 root  named   61 Jul 18 10:42 chroot
drwxrwx---. 2 named named   23 Jul 18 10:33 data
drwxrwx---. 2 named named   54 Jul 18 10:42 dynamic
-rw-r-----. 1 root  named 2076 Jan 28  2013 named.ca
-rw-r-----. 1 root  named  152 Dec 15  2009 named.empty
-rw-r-----. 1 root  named  152 Jun 21  2007 named.localhost
-rw-r-----. 1 root  named  168 Dec 15  2009 named.loopback
drwxrwx---. 2 named named    6 Jul  1 01:45 slaves
-rw-r--r--. 1 root  root   373 Jul 18 10:39 srv.world.lan
 
Tweet